import React, { PureComponent } from 'react';
import { Card } from 'antd';
import moment from 'moment';
import DescriptionList from '@/components/DescriptionList';

const { Description } = DescriptionList;
class EmpInfor extends PureComponent {
  jumpRouting = (targetRouter, id) => {
    const { jumpRouting } = this.props;
    jumpRouting(targetRouter, id);
  };

  render() {
    const { empLaborContInfo } = this.props;
    return (
      <div>
        <Card
          id="laborContractInfor"
          title={<span>劳动合同信息</span>}
          extra={
            <a
              onClick={() =>
                this.jumpRouting('laborContId', empLaborContInfo && empLaborContInfo.laborContId)
              }
            >
              详情&gt;&gt;
            </a>
          }
        >
          {empLaborContInfo && (
            <DescriptionList>
              <Description term="客户名称">{empLaborContInfo.custName || '--'}</Description>
              <Description term="合同编号">{empLaborContInfo.contNo || '--'}</Description>
              <Description term="合同开始日期">
                {empLaborContInfo.contBeginDate
                  ? moment(empLaborContInfo.contBeginDate).format('YYYY-MM-DD')
                  : '--'}
              </Description>
              <Description term="合同结束日期">
                {empLaborContInfo.contEndDate
                  ? moment(empLaborContInfo.contEndDate).format('YYYY-MM-DD')
                  : '--'}
              </Description>
              <Description term="合同状态">{empLaborContInfo.contStateName || '--'}</Description>
              <Description term="签订类型">{empLaborContInfo.signTypeName || '--'}</Description>

              <Description term="合同签署方式">
                {empLaborContInfo.contSignWayName || '--'}
              </Description>
              <Description term="签订日期">
                {empLaborContInfo.signDate
                  ? moment(empLaborContInfo.signDate).format('YYYY-MM-DD')
                  : '--'}
              </Description>
            </DescriptionList>
          )}
        </Card>
      </div>
    );
  }
}

export default EmpInfor;
